<template>
  <div>
    <a-row type="flex">
      <a-col  :md="18" :sm="24">
        <detail-list :col="2">
          <detail-list-item term="学号">{{ studentData.xh }}&nbsp;</detail-list-item>
          <detail-list-item term="姓名">{{ studentData.xm }}&nbsp;</detail-list-item>
          <detail-list-item term="性别">{{ studentData.xbmc }}&nbsp;</detail-list-item>
          <detail-list-item term="院系">{{ studentData.xjxx && studentData.xjxx.ssyxmc }}&nbsp;</detail-list-item>
          <detail-list-item term="专业">{{ studentData.xjxx && studentData.xjxx.sszymc }}&nbsp;</detail-list-item>
          <detail-list-item term="学科专业码">{{ studentData.xjxx && studentData.xjxx.sszym }}&nbsp;</detail-list-item>
          <detail-list-item term="证件类型">{{ studentData.sfzjlxmc }}&nbsp;</detail-list-item>
          <detail-list-item term="身份证号">{{ zjhm }}&nbsp;
            <a-button v-if="isShow[0].one" type="primary" size="small" @click="seeNumber( studentData.zjhm,1 )">
              查看
            </a-button>
            <a-button v-if="!isShow[0].one" type="primary" size="small" @click="hideNumberZjhm( studentData.zjhm )">
              隐藏
            </a-button>
          </detail-list-item>
          <detail-list-item term="出生日期">{{ studentData.csrq && studentData.csrq.format('YYYY-MM-DD') }}&nbsp;</detail-list-item>
          <detail-list-item term="姓名拼音">{{ studentData.xmpy }}&nbsp;</detail-list-item>
          <detail-list-item term="曾用名">{{ studentData.cym }}&nbsp;</detail-list-item>
          <detail-list-item term="英文名">{{ studentData.ywxm }}&nbsp;</detail-list-item>
          <detail-list-item term="婚姻状况">{{ studentData.hyzkmc }}&nbsp;</detail-list-item>
          <detail-list-item term="个人电话">{{ lxdh }}&nbsp;
            <a-button v-if="isShow[1].two" type="primary" size="small" @click="seeNumber(studentData.lxdh,2)">
              查看
            </a-button>
            <a-button v-if="!isShow[1].two" type="primary" size="small" @click="hideNumberLxdh(studentData.lxdh)">
              隐藏
            </a-button>
          </detail-list-item>
          <detail-list-item term="宿舍电话">{{ studentData.ssdh }}&nbsp;</detail-list-item>
          <detail-list-item term="QQ号码">{{ studentData.qqhm }}&nbsp;</detail-list-item>
          <detail-list-item term="实验室电话">{{ studentData.sysdh }}&nbsp;</detail-list-item>
          <detail-list-item term="家庭电话">{{ studentData.jtdh }}&nbsp;</detail-list-item>
          <detail-list-item term="民族">{{ studentData.mzmc }}&nbsp;</detail-list-item>
          <detail-list-item term="政治面貌">{{ studentData.zzmmmc }}&nbsp;</detail-list-item>
          <detail-list-item term="宿舍地址">{{ studentData.ssdz }}&nbsp;</detail-list-item>
          <detail-list-item term="健康状况">{{ studentData.jkzkmc }}&nbsp;</detail-list-item>
          <detail-list-item term="家庭地址">{{ studentData.jtzz }}&nbsp;</detail-list-item>
          <detail-list-item term="通讯地址">{{ studentData.txdz }}&nbsp;</detail-list-item>
          <detail-list-item term="所在教研室">{{ studentData.szjyshyjjg }}&nbsp;</detail-list-item>
          <detail-list-item term="家庭地址邮编">{{ studentData.jyyzbm }}&nbsp;</detail-list-item>
          <detail-list-item term="籍贯">{{ studentData.jgsdmc }}&nbsp;{{ studentData.jgcdmc }}&nbsp;{{ studentData.jgxqdmc }}</detail-list-item>
          <detail-list-item term="出生地">{{ studentData.csdsdmc }}&nbsp;{{ studentData.csdcdmc }}&nbsp;{{ studentData.csdxqdmc }}</detail-list-item>
<!--          <detail-list-item term="本人成分">{{ studentData.brcf }}&nbsp;</detail-list-item>-->
          <detail-list-item term="电子邮箱">{{ studentData.dzxx }}&nbsp;</detail-list-item>
          <detail-list-item term="借书证号">{{ studentData.xjxx && studentData.xjxx.jszh }}&nbsp;</detail-list-item>
          <detail-list-item term="血型">{{ studentData.xxmc }}&nbsp;</detail-list-item>
          <detail-list-item term="考生编号">{{ studentData.xjxx && studentData.xjxx.ksbh }}&nbsp;</detail-list-item>
          <detail-list-item term="会何种外语">{{ studentData.hhzwy }}&nbsp;</detail-list-item>
          <detail-list-item term="外语熟练程度">{{ studentData.wyslcdmc }}&nbsp;</detail-list-item>
          <detail-list-item term="入学前最后学历">{{ studentData.rxqzhxlmc }}&nbsp;</detail-list-item>
          <detail-list-item term="大学毕业年月">{{ studentData.xjxx.xslbm === '431' ? (studentData.dxbyny && studentData.dxbyny.format('YYYY-MM-DD')) : (studentData.ssbyny && studentData.ssbyny.format('YYYY-MM-DD')) }}&nbsp;</detail-list-item>
          <detail-list-item term="最后毕业学校名称">{{ studentData.xjxx.xslbm === '431' ? studentData.dxbyxxmc : studentData.ssbyxxmc }}&nbsp;</detail-list-item>
          <detail-list-item term="入学前最后学位">{{ studentData.rxqzhxwmc }}&nbsp;</detail-list-item>
          <detail-list-item term="最高学位学科门类">{{ studentData.xjxx.xslbm === '431' ? studentData.xsxwxkmldmc : studentData.ssxwxkmlmc }}&nbsp;</detail-list-item>
          <detail-list-item term="最高学历专业">{{ studentData.xjxx.xslbm === '431' ? studentData.dxbyxy : studentData.ssbyzy }}&nbsp;</detail-list-item>
          <detail-list-item term="最高学历单位">{{ studentData.xjxx.xslbm === '431' ? studentData.sxsxwdwmc : studentData.sssxwdwmc }}&nbsp;</detail-list-item>
          <detail-list-item term="何时参加工作">{{ studentData.hscjgz && studentData.hscjgz.format('YYYY-MM-DD') }}&nbsp;</detail-list-item>
          <detail-list-item term="何地参加工作">{{ studentData.hdcjgz }}&nbsp;</detail-list-item>
          <detail-list-item term="原工资级别">{{ studentData.ygzjb }}&nbsp;</detail-list-item>
          <detail-list-item term="何时入党或入团">{{ studentData.hsrdht && studentData.hsrdht.format('YYYY-MM-DD') }}&nbsp;</detail-list-item>
          <detail-list-item term="何地入党或入团">{{ studentData.hdrdht }}&nbsp;</detail-list-item>
          <detail-list-item term="配偶姓名">{{ studentData.poxm }}&nbsp;</detail-list-item>
          <detail-list-item term="配偶政治面貌">{{ studentData.pozzmmmc }}&nbsp;</detail-list-item>
          <detail-list-item term="配偶工作单位">{{ studentData.pogzdw }}&nbsp;</detail-list-item>
        </detail-list>
      </a-col>
      <a-col :span="4">
        <img style="width:100%" :src="studentData.zpdz ? `${IMG_URL}${studentData.zpdz}` : require('@/assets/avator.jpg')" alt="">
      </a-col>
    </a-row>
    <a-row style="margin:10px 0;">参加过哪些研究工作：</a-row>
    <a-row>{{ studentData.cjgnxyjgz }}</a-row>
    <a-row style="margin:10px 0;">有何论文或著作：</a-row>
    <a-row>{{ studentData.yhlwhzz }}</a-row>
    <a-row style="margin:10px 0;">自我鉴定：</a-row>
    <a-row>{{ studentData.zwjd }}</a-row>
  </div>
</template>

<script>
import DetailList from '~/tool/DetailList'
const DetailListItem = DetailList.Item

export default {
  // props: ['studentData']
  props: {
    studentData: {
      type: Object,
      default: {
        xslbm: '',
        xjxx: {},
      }
    }
  },
  components: {DetailList, DetailListItem},
  data () {
    return {
      IMG_URL: process.env.IMG_URL,
      isShow: [{one:true},{two:true}],
      zjhm: '',
      lxdh: ''
    }
  },
  watch:{
    studentData(){
      console.log(this.studentData)
      this.hideNumberZjhm(this.studentData.zjhm)
      this.hideNumberLxdh(this.studentData.lxdh)
    }
  },
  created(){

  },
  methods:{
    seeNumber(num,n){
      console.log(num)
        if(n == 1){
          this.zjhm = num
          this.isShow[0].one = false
        }else if(n == 2){
          this.lxdh = num
          this.isShow[1].two = false
        }else{
          this.gnlxrdh = num
          this.isShow[2].three = false
        }
      },
      hideNumberZjhm(num){
      console.log(num)
        let arr = []
          arr = num.split('').map((item,index) => {
            if( index > 5 ){
              return item.replace(item,'*')
            }
            return item
          })
          this.zjhm = arr.join('')
          this.isShow[0].one = true
      },
      hideNumberLxdh(num){
        console.log(num)
        let arr = []
          arr = num.split('').map((item,index) => {
            if(index > 2){
              return item.replace(item,'*')
            }
            return item
          })
          this.lxdh = arr.join('')
          this.isShow[1].two = true
      },
  }
}
</script>

<style>

</style>
